﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.CompositeUI;
using Microsoft.Practices.ObjectBuilder;
using Shortcuts.Services;

namespace Shortcuts
{
	public sealed class Module : ModuleInit
	{
		private WorkItem _rootWorkItem;

		[InjectionConstructor]
		public Module([ServiceDependency] WorkItem rootWorkItem)
		{
			_rootWorkItem = rootWorkItem;
		}

		public override void AddServices()
		{
			base.AddServices();
			_rootWorkItem.Services.AddNew<ShortcutsService, IShortcutsService>();
		}

		public override void Load()
		{
			base.Load();
			//run the shortcuts work item
			_rootWorkItem.WorkItems.AddNew<ShortcutsWorkItem>().Run();
		}
	}
}
